﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MPev
{
    public partial class InputClassForm : Form
    {
        //public string retStr;
        public MPClass inputclass;
        
        public InputClassForm()
        {
            InitializeComponent();
        }

        private void okBtn_Click(object sender, EventArgs e)
        {
            createMPClass();
            DialogResult = DialogResult.OK;
            Close();
        }

        private void detectEnter(object sender, KeyEventArgs e)
        {

            if (e.KeyCode == Keys.Enter)
            {
                createMPClass();
                DialogResult = DialogResult.OK;
                Close();
            }

        }
        private void createMPClass()
        {
            inputclass = new MPClass();
            inputclass.name = textBox1.Text;
            if (textBox2.Text != "") inputclass.attr.Add(textBox2.Text);
            if (textBox3.Text != "") inputclass.attr.Add(textBox3.Text);
            if (textBox4.Text != "") inputclass.attr.Add(textBox4.Text);
        }
    }
}
